<?php 
header("content-type:text/html;charset=utf8");
$dsn = "mysql:host=127.0.0.1;dbname=goods;charset=utf8";
$pdo = new PDO($dsn,"root","root");
$sql = "select * from import";
// print_r($sql);die;
$st = $pdo->query($sql);
$data = $st->fetchAll(PDO::FETCH_ASSOC);
// print_r($sql);die;

 ?>
 <table border="2">
 <a href="dc.php">导出</a>
 	<tr>
 		<td>编号</td>
 		<td>姓名</td>
 		<td>年龄</td>
 		<td>薪资</td>
 		<td>操作</td>
 	</tr>
 	<?php foreach ($data as $k => $v) {?>
 	<tr>
 		<td><?php echo $v['id'] ?></td>
 		<td><?php echo $v['name'] ?></td>
 		<td><?php echo $v['age'] ?></td>
 		<td><?php echo $v['money'] ?></td>
 		<td><a href="save.php?id=<?php echo $v['id'] ?>">修改</a> | <a href="delete.php?id=<?php echo $v['id'] ?>">删除</td>
 	</tr>
 	<?php } ?>
 </table>
 <a href="add,html">添加</a>